
import Vue from 'vue'
import 'normalize.css/normalize.css' // A modern alternative to CSS resets
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
import locale from 'element-ui/lib/locale/lang/en' // lang i18n

import '@/styles/index.scss' // global css
import '../static/font/iconfont.css'
import App from './App'
import store from './store'
import router from './router' //不需要权限控制的

import '@/icons' // icon
import './permission' // permission control

import '@/utils/directives.js'; //对话框可拖拽
import '@/utils/btnPermisson.js'; //按钮
import echarts from 'echarts'
// import Base64 from ('js-base64').Base64
import dayjs from 'dayjs'
Vue.prototype.$dayjs = dayjs

/*禁止回退*/
import {
  banBackSpace
} from '@/utils/banBackSpace'
document.onkeydown = banBackSpace;

// 禁用浏览器前进后退
window.history.pushState(null, null, window.location.href);
window.addEventListener('popstate', function () {
  window.history.forward(-1);
  window.history.pushState(null, null, window.location.href);
});

Vue.prototype.$echarts = echarts
// Vue.prototype.$Base64 = Base64

// set ElementUI lang to EN
// Vue.use(ElementUI, { locale })
// 如果想要中文版 element-ui，按如下方式声明
Vue.use(ElementUI)
ElementUI.Dialog.props.closeOnClickModal.default = false; // 修改 el-dialog 默认点击遮照为不关闭

Vue.config.productionTip = false
new Vue({
  el: '#app',
  router,
  store,
  render: h => h(App)
})
